<?php
defined('BME_INSERTION') or die('Error code: '.BME_INVALID_INSERT_ERROR);

if(ereg("^([^:]*):(.*)",$query,$reg)){
	$search=$reg[1];
	$query=$reg[2];
}else{
	$search=$query;
	$query="";
}
if(ereg("^ds-([0-9\.]+)$",$search,$reg)){
	require_once(BME_ROOT."core/Dataset.php");
	$Ds=new BME_Dataset((int)$reg[1]);
	$QSqs=$Ds->getSeqsId();
}elseif(ereg("^pc-([0-9\.]+)$",$search,$reg)){
	require_once(BME_ROOT."core/Protocol.php");
	$Pc=new BME_Protocol((int)$reg[1]);
	$QSqs=$Pc->getSeqsId();
	
}else{
	$QSqs=array();
	$Bme=new BME_Base();
	$file=$Bme->tmp_path."search/$search";
	if(file_exists($file) && is_readable($file)){
		$qq=unserialize(file_get_contents($file));
		require_once(BME_ROOT."core/Sequence.php");
		$Sqs=new BME_Sequence();
		$QSqs=$Sqs->search($qq);
	}
}
$_rq="query/menu/search_sequences:$search";
include(BME_ROOT."gui/mod/query.sequences.php");
?>
